import { BasicFetchResult, SaaSPageParams } from '/@/api/model/baseModel';

export type ComponentQueryParams = {
  appId: string;
  componentName: string;
};

export type ComponentSelectParams = {
  appId: string;
  name: string;
};

export type ComponentListParams = {
  name: string;
};

export type ComponentQueryPageParams = {
  model: ComponentQueryParams;
} & SaaSPageParams;

export interface ComponentInfo {
  id: string;
  componentName: string;
  type: string;
  runtime: string;
  framework: string;
  port: number;
  contextPath: string;
  appId: string;
  isTenantShared: boolean;
  isGateway: boolean;
  label: string;
  isForPlatform: string;
}

export type ComponentListResultModel = BasicFetchResult<ComponentInfo>;

export interface ComponentLabelItem {
  value: string;
  description: string;
}

export interface PreferredModel {
  size: number;
}

export interface RelationshipModel {
  componentId: string;
  componentName: string;
  downstreamComponentId: string[];
  downstreamComponentName: string[];
  downstreamComponentNameTableData: string;
  upstreamComponentId: string[];
  upstreamComponentName: string[];
  upstreamComponentNameTableData: string;
  appId: string;
}
